package newsSystem.Order;


import newsSystem.dao.OrderInfoJDBC;

import java.util.List;

public class OrderPage {
    private static List<OrderInfo> OrderList;
    public static void main(String[] args) throws Exception {
//        调用OrderJDBC方法
//        OrderInfoJDBC.orderJDBC();
        OrderInfoJDBC.getOrderInfoByUserID("ttt");
//        调用AdminManager的get来测试添加函数,获取管理员数据
        getOrderList();

    }
    public static void getOrderList() {

        OrderList = OrderManager.getOrderList();
        // 遍历管理员集合
        for (OrderInfo order : OrderList) {
            System.out.println("OrderNo: " + order.getOrderNo() + ", OrderAmount: " + order.getOrderAmount() + ", OrderMonth: " + order.getOrderMonth() + ", OrderPrice: " + order.getOrderPrice() + ",OrderDate:" + order.getOrderDate() + ",UserID:" + order.getUserID() + ", 部门名称: " + order.getAdminID() + ",  报刊名称: " + order.getNewsID());
        }
    }
    // 通过构造函数传递 OrderList
    public OrderPage(List<OrderInfo> OrderList) {
        this.OrderList = OrderList;
    }

    // 或者通过方法传递 OrderList
    public void setOrderList(List<OrderInfo> OrderList) {
        this.OrderList = OrderList;
    }
}